<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>联系人信息显示页面</title>
    
	<link rel="stylesheet" type="text/css" href="css/commonStyle.css">
	
	<script type="text/javascript " src="dwr/engine.js"></script>
	<script type="text/javascript " src="dwr/util.js"></script>
	<script type="text/javascript " src="dwr/interface/contactAjax.js"></script>
	<script type="text/javascript " src="js/JQuery.js"></script>
	<script type="text/javascript " src="lhgdialog/lhgdialog.min.js"></script>
	<script type="text/javascript" src="js/Calendar.js" ></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript" src="js/contactList.js"></script>

  </head>
  
  <body>
    <center>
    <form action="Contact_queryByProperty.action" method="post">
	    <table class="fullTableStyle">
	    	<thead>
	    		<tr>
	    			<td><span>按条件查询联系人信息：</span></td>
	    		</tr>
	    	</thead>
	    	<tbody>
	    		<tr>
	    			<td>
	    				姓名：<input type="text" name="name" value="${ request.flag == true ? request.name : '' }"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						公司名：<input type="text" name="customerName" value="<s:property value='#request.customerName' />" />
	    				<input type="submit" value="" style="background: url('img/query.png')" class="queryLogo" />
	    			</td>
	    		</tr>
	    	</tbody>
	    </table>
    </form>
    
    <table class="fullTableStyle">
    	<thead>
    		<tr class="theadNoTitle">
    			<td colspan="13">
    				<span>联系人信息显示</span>
    				<a href="#" onclick="return contactAdd()" >&cong;添加联系人</a>
    			</td>
    		</tr>
    		<tr>
    			<td><input type="checkbox" onclick="checkAll(this)"/></td>
    			<td>编号</td>
    			<td>姓名</td>
    			<td>职务</td>
    			<td>客户名称</td>
    			<td>性别</td>
    			<td>个人手机</td>
    			<td>办公电话</td>
    			<td>电子邮箱</td>
    			<td>登记日期</td>
    			<td>查看详细</td>
    			<td>修改</td>
    			<td>删除</td>
    		</tr>
    	</thead>
    	<tbody>
    		<s:iterator value="contacts" var="contact">
	    		<tr>
	    			<td><input type="checkbox" value="<s:property value='#contact.id' />" name="contactIds" /></td>
	    			<td><s:property value="#contact.id" /></td>
	    			<td><s:property value="#contact.name" /></td>
	    			<td><s:property value="#contact.business" /></td>
	    			<td><s:property value="#contact.customerInfo.name" /></td>
	    			<td>
						<s:if test="#contact.sex == 1">男</s:if>
						<s:else>女</s:else>
					</td>
	    			<td><s:property value="#contact.phone" /></td>
	    			<td><s:property value="#contact.cellphone" /></td>
	    			<td><s:property value="#contact.email" /></td>
	    			<td><s:property value="#contact.regDate" /></td>
	    			<td><input type="button" onclick="showDetail(${contact.id})" style="background: url('img/detail.png');" class="showDetailStyle" /></td>
	    			<td><input type="button" onclick="editContact(${contact.id})" style="background: url('img/edit.png');" class="littleLogo" /></td>
	    			<td><input type="button" onclick="delContact(${contact.id})" style="background: url('img/del.png');" class="littleLogo" /></td>
	    		</tr>
    		</s:iterator>
    	</tbody>
    	<tfoot>
    		<tr>
    			<td colspan="13">
    				<ul>
    					<!-- 设定每页显示记录数 -->
    					<li>
    						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;条/页
	    					<span class="countEveryPage">
	    						<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest( 10 , true)" >10</a>
			    				</s:if>
			    				<s:else>
				    				<a href="Contact_list.action?pageSize=10">10</a>
			    				</s:else>
	    					</span>
		    				<span class="countEveryPage">
	    						<s:if test="#request.flag == true">
				    				<a href="#" onclick="return pageRequest( 15 , true)" >15</a>
			    				</s:if>
			    				<s:else>
				    				<a href="Contact_list.action?pageSize=15">15</a>
			    				</s:else>
		    				</span>
    					</li>
    					<!-- 设定每页显示记录数 -->
    					
    					<!-- 分页超链接 -->
    					<li>
    					<s:if test="#request.flag == true">
    						<a href="#" onclick="return pageRequest( ${page.pageCount} , false)" >尾页</a>
    					</s:if>
    					<s:else>
    						<a href="Contact_list.action?pageNumber=${ page.pageCount }">尾页</a>
    					</s:else>
    					</li>
    					<s:if test="page.hasNext">
	    					<li>
	    					<s:if test="#request.flag == true">
	    						<a href="#" onclick="return pageRequest( ${page.pageNumber + 1} , false)" >下一页</a>
	    					</s:if>
	    					<s:else>
	    						<a href="Contact_list.action?pageNumber=${ page.pageNumber + 1 }">下一页</a>
	    					</s:else>
	    					</li>
    					</s:if>
    					<s:if test="page.hasPre">
	    					<li>
	    					<s:if test="#request.flag == true">
	    						<a href="#" onclick="return pageRequest( ${page.pageNumber - 1} , false)" >上一页</a>
	    					</s:if>
	    					<s:else>
	    						<a href="Contact_list.action?pageNumber=${ page.pageNumber - 1 }">上一页</a>
	    					</s:else>
	    					</li>
    					</s:if>
    					<li>
    					<s:if test="#request.flag == true">
	    						<a href="#" onclick="return pageRequest( 1 , false)" >首页</a>
    					</s:if>
    					<s:else>
    						<a href="Contact_list.action?pageNumber=1">首页</a>
    					</s:else>
    					</li>
    					<!-- 分页超链接 -->
    					
    					<!-- 页面信息显示 -->
   						<li class="tfootContStyle"><input type="button" value="批量删除" onclick="delSelectedContacts()" /></li>
    					<li class="tfootContStyle"><span>共&nbsp;<s:property value="page.pageCount" />&nbsp;页,&nbsp;<s:property value="page.recordCount" />&nbsp;条记录,这是第&nbsp;<s:property value="page.pageNumber" />&nbsp;页</span></li>
		    			<li class="tfootContStyle"><span>此页显示第&nbsp;<s:property value="page.beginIndex + 1" />&nbsp;条到第&nbsp;<s:property value="page.endIndex" />&nbsp;条记录</span></li>
    					<!-- 页面信息显示 -->
    				</ul>
    			</td>
    		</tr>
    	</tfoot>
    </table>
    </center>
  </body>
</html>
